import { Entity, Column, ObjectIdColumn, ObjectID, BaseEntity } from 'typeorm'
import { Status } from '../app.types'

@Entity()
export class User extends BaseEntity {
  @ObjectIdColumn()
  id: ObjectID

  @Column({ unique: true })
  username: string

  @Column()
  password: string

  @Column({ unique: true})
  email: string

  @Column()
  role: string[] = []

  @Column()
  status: Status = Status.normal
}
